package com.durian.financial.api.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.durian.common.core.annotation.Excel;
import com.durian.common.core.web.domain.BaseEntity;
import com.durian.financial.api.domain.enums.AccountTypeEnum;
import com.durian.financial.api.domain.enums.CompanyEnum;
import com.durian.financial.api.domain.enums.ProductApplyEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 金融产品对象 t_jr_product
 * 
 * @author durian
 * @date 2022-06-22
 */
@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper = true)
public class JrProduct extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 自增 */
    private Long id;

    /** 产品名称 */
    @Excel(name = "产品名称")
    @NotEmpty(message = "产品名称不可为空")
    private String jrProductName;

    /** 资方信息ID */
    @Excel(name = "资方信息ID")
    @NotNull(message = "请选择资金提供方")
    private CompanyEnum companyId;

    /** 资金提供方 */
    @Excel(name = "资金提供方")
    private String companyName;

    /** 分期期限(-1表示无限期) */
    @NotNull(message = "请选择分期期限")
    private Long instalmentPeriod;

    @Excel(name = "分期期限(-1表示无限期)")
    private String instalmentPeriodName;

    /** 授信额度(单位：%，比如80%，存的是80) */
    @Excel(name = "授信额度(单位：%，比如80%，存的是80)")
    @NotNull(message = "请输入授信额度")
    @DecimalMin(message = "授信额度最小0.01",value = "0.01")
    @DecimalMax(message = "授信额度最大不可超过100",value = "100")
    private BigDecimal creditLine;

    /**
        金融产品类型
        租房分期
        收房贷
        应收租约保理"
     */
    @Excel(name = "金融产品类型")
    private Integer jrProductType;

    /** 还款方式
        1：按月还款
        2：按季还款
        3：按租约周期支付
     */
    @NotNull(message = "请选择还款方式")
    private Integer repaymentType;

    @Excel(name = "还款方式")
    private String repaymentTypeName;


    /** 支付PC链接(URL) */
    @Excel(name = "支付PC链接(URL)")
    private String urlPayPc;

    /** 支付移动链接(URL) */
    @Excel(name = "支付移动链接(URL)")
    private String urlPayMoble;

    /** 补全信息PC(URL) */
    @Excel(name = "补全信息PC(URL)")
    private String urlAddDetailInfoPc;

    /** 补全信息移动(URL) */
    @Excel(name = "补全信息移动(URL)")
    private String urlAddDetailInfoMobile;

    /** App下载(URL) */
    @Excel(name = "App下载(URL)")
    private String urlAppDownload;

    /** 银行账户类型（对公账户、对私账户）AccountTypeEnum */
    @Excel(name = "银行账户类型", readConverterExp = "对=公账户、对私账户")
    private AccountTypeEnum accountType;

    /** 银行卡号 */
    @Excel(name = "银行卡号")
    private String bankCardNumber;

    /** 开户银行ID */
    @Excel(name = "开户银行ID")
    private Long bankId;

    /** 银行名称 */
    @Excel(name = "银行名称")
    private String bankName;

    /** 开户行(支行) */
    @Excel(name = "开户行(支行)")
    private String openingBank;

    /** 账户名称（对公为企业名称，对私为姓名） */
    @Excel(name = "账户名称", readConverterExp = "对=公为企业名称，对私为姓名")
    private String accountName;

    /** 账户信息 */
    @Excel(name = "账户信息")
    private String accountInformation;

    /** 联行行号（手输，对公必须） */
    @Excel(name = "联行行号", readConverterExp = "手=输，对公必须")
    private String bankBranchCodeLh;

    /** 开户行所在省ID */
    @Excel(name = "开户行所在省ID")
    private Long bankAccountProvince;

    /** 申请条件 */
    @Excel(name = "申请条件")
    @NotEmpty(message = "请输入申请条件")
    private String applicationConditions;

    /** 风控要求 */
    @Excel(name = "风控要求")
    @NotEmpty(message = "请输入风控要求")
    private String riskRequirement;

    /** 预留字段1 */
    @Excel(name = "预留字段1")
    private Long reserve1;

    /** 预留字段2 */
    @Excel(name = "预留字段2")
    private Long reserve2;

    /** 预留字段3 */
    @Excel(name = "预留字段3")
    private String reserve3;

    /** 预留字段4 */
    @Excel(name = "预留字段4")
    private String reserve4;

    /** 预留字段5 */
    @Excel(name = "预留字段5")
    private String reserve5;

    /**
        删除标识
        0:未删除，1：删除
     */
    @Excel(name = "删除标识")
    private Integer delFlg;

    /** 创建用户ID */
    @Excel(name = "创建用户ID")
    private Long createUserid;

    /** 更新用户ID */
    @Excel(name = "更新用户ID")
    private Long updateUserid;

    /**申请状态**/
    private ProductApplyEnum applyState;

    private String applyStateName;
}
